package com.movitech.mobile.cz.base.modules.activiti.service;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.movitech.mobile.cz.base.modules.activiti.dao.AProcessDefinitionConfigMapper;
import com.movitech.mobile.cz.base.modules.activiti.entity.AProcessDefinitionConfig;

@Service
public class AProcessDefinitionConfigService {
    protected Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private AProcessDefinitionConfigMapper aProcessDefinitionConfigMapper;
	
	/***
	 * 根据id，获取Activiti流程配置对象
	 * @param id
	 * @return
	 */
    public AProcessDefinitionConfig getAProcessDefinitionConfigById(String id) {
    	AProcessDefinitionConfig aProcessDefinitionConfig = null;
    	if(StringUtils.isNotEmpty(id)){
    		aProcessDefinitionConfig = aProcessDefinitionConfigMapper.selectByPrimaryKey(id);
    	}
    	return aProcessDefinitionConfig;
    }

    /***
     * 保存AProcessDefinitionConfig对象
     * @param aProcessDefinitionConfig
     */
    public void saveAProcessDefinitionConfig(AProcessDefinitionConfig aProcessDefinitionConfig) {
    	aProcessDefinitionConfigMapper.insertSelective(aProcessDefinitionConfig);
    }
    
    /***
     * 更新AProcessDefinitionConfig对象
     * @param aProcessDefinitionConfig
     */
    public void updateAProcessDefinitionConfig(AProcessDefinitionConfig aProcessDefinitionConfig) {
    	aProcessDefinitionConfigMapper.updateByPrimaryKeySelective(aProcessDefinitionConfig);
    }
    
    
}
